import React from 'react';

/** 申请页面上下文类型 */
export interface IClarificationContextAPI {
  styleFixCls: string;
  infoObj: Record<string, any>;
  reloadDetail: () => void;
  curRes: Record<string, any>;
  invalidState: Record<string, any>;
  setInvalidState: (resObj: Record<string, any>) => void;
  setOAMessageRun: (res: Record<string, any>) => any;
  taskId: string;
}

/** 申请管理上下文 */
const Clarification_Context: IClarificationContextAPI = {
  styleFixCls: '',
  infoObj: {},
  reloadDetail: () => {},
  curRes: {},
  invalidState: {},
  setInvalidState: () => {},
  setOAMessageRun: () => {},
  taskId: '',
};

const IClarificationControllerContext = React.createContext<IClarificationContextAPI>(Clarification_Context);

/** 申请页面上下文类型 */
export interface ICalibrateContextAPI {
  styleFixCls: string;
  infoObj: Record<string, any>;
  reloadDetail: () => void;
  invalidState: Record<string, any>;
  setInvalidState: (res: Record<string, any>) => void;
  curRes: Record<string, any>;
  setOAMessageRun: (res: Record<string, any>) => any;
  taskId: string;
}

/** 申请管理上下文 */
const Calibrate_Context: ICalibrateContextAPI = {
  styleFixCls: '',
  infoObj: {},
  reloadDetail: () => {},
  invalidState: {},
  setInvalidState: (res: Record<string, any>) => {},
  curRes: {},
  setOAMessageRun: () => {},
  taskId: '',
};

const ICalibrateControllerContext = React.createContext<ICalibrateContextAPI>(Calibrate_Context);

export { ICalibrateControllerContext, IClarificationControllerContext };
